package levels;

import gameobjects.EyeballSpawn;
import gameobjects.Mage;
import resources.Music;
import tools.GameApplet;
import abstracts.Level;
import land.Land;

public class TestLevel extends Level {
    public TestLevel(GameApplet applet) {
        super(applet);
    }

    @Override
    public void load() {
        getCollisionGrid()
                .createFromString("9912F524EFC9F8951C3C7F38F7B247C326BFA708963CD"
                        + "23F0846E0258F5A11757D79207CBFCDEA6056ECEF81FE8643B83FB5F"
                        + "F6333D7642B5C53B907E24642B3160601D0B9042D73A1FB9AEEF6814"
                        + "E59CCAF2B547782");

        new Land(getCollisionGrid(), this);

        add(new Mage(this, 1, 1));

        add(new EyeballSpawn(this, 8, 12));
        add(new EyeballSpawn(this, 3, 8));
        add(new EyeballSpawn(this, 8, 4));

        for (int i = 0; i < 30; i++) {
            int row = (int) (Math.random() * getHeight() / 32);
            int col = (int) (Math.random() * getWidth() / 32);
            if (!getCollisionGrid().isSolid(row, col)) {
                // add(new Ruby(this, row, col));
            }
        }

        Music.set(Music.BACKGROUND_1);
    }
}
